<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <script src="/js/jquery-1.9.1.min.js"></script>
    <script src="/js/fileupload.js"></script>
</head>
<body>
 <a href="list.do"><h1>欢迎</h1></a>
<form action="login.do" method="post">
    用户名：<input type="text" name="uname"><span id="unameMsg"></span><br>
    密码：<input type="text" name="password"><br>
    <input type="submit" value="登录" onclick="qwe()">
</form>
</body>
</html>
<script>
    function qwe() {
        var count=0;
        if ($("[name='uname']").val().length==0){
            $("#unameMsg").text("不能为空")
            alert("不能为空")
        }
        $("form").submit()

    }

</script>
